package com.morphiastic.tests.fieldbridges;

import org.bson.types.ObjectId;

import com.google.code.morphia.annotations.Entity;
import com.google.code.morphia.annotations.Id;
import com.morphiastic.analysis.analyzers.ElasticAnalyzerType;
import com.morphiastic.analysis.analyzers.LanguageAnalyzer;
import com.morphiastic.analysis.analyzers.SnowballAnalyzer;
import com.morphiastic.annotations.Analyzer;
import com.morphiastic.annotations.AnalyzerDefinition;
import com.morphiastic.annotations.AnalyzerDefinitions;
import com.morphiastic.annotations.ElastiField;
import com.morphiastic.annotations.ElastiFieldBridge;
import com.morphiastic.annotations.ElastiMorphed;
import com.morphiastic.annotations.Parameter;


@AnalyzerDefinitions(value = {
		
		@AnalyzerDefinition(defName = "frenchsnowball", type=ElasticAnalyzerType.snowball, parameters= {@Parameter(key = SnowballAnalyzer.LANGUAGE_PARAM_KEY, value = "French")}),
		@AnalyzerDefinition(defName = "germansnowball", type=ElasticAnalyzerType.snowball, parameters= {@Parameter(key = SnowballAnalyzer.LANGUAGE_PARAM_KEY, value = "German")}),
		@AnalyzerDefinition(defName = "italiansnowball", type=ElasticAnalyzerType.snowball, parameters= {@Parameter(key = SnowballAnalyzer.LANGUAGE_PARAM_KEY, value = "Italian")}),
		@AnalyzerDefinition(defName = "spanishsnowball", type=ElasticAnalyzerType.snowball, parameters= {@Parameter(key = SnowballAnalyzer.LANGUAGE_PARAM_KEY, value = "Spanish")}),
		@AnalyzerDefinition(defName = "catalansnowball", type=ElasticAnalyzerType.snowball, parameters= {@Parameter(key = SnowballAnalyzer.LANGUAGE_PARAM_KEY, value = "Catalan")}),
		@AnalyzerDefinition(defName = "portuguesesnowball", type=ElasticAnalyzerType.snowball, parameters= {@Parameter(key = SnowballAnalyzer.LANGUAGE_PARAM_KEY, value = "Portuguese")}),
		@AnalyzerDefinition(defName = "dutchsnowball", type=ElasticAnalyzerType.snowball, parameters= {@Parameter(key = SnowballAnalyzer.LANGUAGE_PARAM_KEY, value = "Dutch")}),
		@AnalyzerDefinition(defName = "romaniansnowball", type=ElasticAnalyzerType.snowball, parameters= {@Parameter(key = SnowballAnalyzer.LANGUAGE_PARAM_KEY, value = "Romanian")}),
		@AnalyzerDefinition(defName = "hungariansnowball", type=ElasticAnalyzerType.snowball, parameters= {@Parameter(key = SnowballAnalyzer.LANGUAGE_PARAM_KEY, value = "Hungarian")}),
		@AnalyzerDefinition(defName = "finnishsnowball", type=ElasticAnalyzerType.snowball, parameters= {@Parameter(key = SnowballAnalyzer.LANGUAGE_PARAM_KEY, value = "Finnish")}),
		@AnalyzerDefinition(defName = "norwegiansnowball", type=ElasticAnalyzerType.snowball, parameters= {@Parameter(key = SnowballAnalyzer.LANGUAGE_PARAM_KEY, value = "Norwegian")}),
		@AnalyzerDefinition(defName = "turkishsnowball", type=ElasticAnalyzerType.snowball, parameters= {@Parameter(key = SnowballAnalyzer.LANGUAGE_PARAM_KEY, value = "Turkish")}),
		@AnalyzerDefinition(defName = "russiansnowball", type=ElasticAnalyzerType.snowball, parameters= {@Parameter(key = SnowballAnalyzer.LANGUAGE_PARAM_KEY, value = "Russian")}),
		@AnalyzerDefinition(defName = "swedishsnowball", type=ElasticAnalyzerType.snowball, parameters= {@Parameter(key = SnowballAnalyzer.LANGUAGE_PARAM_KEY, value = "Swedish")}),
		
		@AnalyzerDefinition(defName = "czecklanguageanalyzer", type=ElasticAnalyzerType.language, parameters= {@Parameter(key = LanguageAnalyzer.LANGUAGE_PARAM_KEY, value = "czech")}),
		@AnalyzerDefinition(defName = "greeklanguageanalyzer", type=ElasticAnalyzerType.language, parameters= {@Parameter(key = LanguageAnalyzer.LANGUAGE_PARAM_KEY, value = "greek" )}),
		@AnalyzerDefinition(defName = "cjklanguageanalyzer", type=ElasticAnalyzerType.language, parameters= {@Parameter(key = LanguageAnalyzer.LANGUAGE_PARAM_KEY, value = "cjk" )}),
		@AnalyzerDefinition(defName = "hindilanguageanalyzer", type=ElasticAnalyzerType.language, parameters= {@Parameter(key = LanguageAnalyzer.LANGUAGE_PARAM_KEY, value = "hindi" )}),
		@AnalyzerDefinition(defName = "thailanguageanalyzer", type=ElasticAnalyzerType.language, parameters= {@Parameter(key = LanguageAnalyzer.LANGUAGE_PARAM_KEY, value = "thai")}),
		
		@AnalyzerDefinition(defName = "standardpolish", type=ElasticAnalyzerType.standard), //hoping to find something better
		@AnalyzerDefinition(defName = "standardviet", type=ElasticAnalyzerType.standard) //hoping to find something better
		
})//@AnalyzerDefinitions
@ElastiMorphed(typeName="geoname")
@Entity("Geoname")
public class Geoname {

	@Id
	private Long id;
	
	@ElastiField//(analyzer=@Analyzer())
	private String name;
	
	@ElastiField(fieldConverter=@ElastiFieldBridge(bridgeClass=GeonameFeatureCodeExpanderFieldBridge.class))
	private String code;
	
	@ElastiField(fieldConverter=@ElastiFieldBridge(bridgeClass=GeonameFeatureCodeExpanderFieldBridge.class))
	private String code2;
	
	@ElastiField(fieldConverter=@ElastiFieldBridge(bridgeClass=GeonameFeatureCodeExpanderFieldBridge.class,  name="foofoo"))
	private String code3;
	
	
	
	
	
	
	public Geoname(Long id, String name, String code) {
		super();
		this.id = id;
		this.name = name;
		this.code = code;
	}
	
	public Geoname(Long id, String name, String code, String code2, String code3) {
		super();
		this.id = id;
		this.name = name;
		this.code = code;
		this.code2 = code2;
		this.code3 = code3;
	}








	/**
	 * @return the id
	 */
	public Long getObjectId() {
		return id;
	}
	
	/**
	 * @param id the id to set
	 */
	public void setObjectId(Long id) {
		this.id = id;
	}
	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}
	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}
	/**
	 * @return the code
	 */
	public String getCode() {
		return code;
	}
	/**
	 * @param code the code to set
	 */
	public void setCode(String code) {
		this.code = code;
	}



	/**
	 * @return the code2
	 */
	public String getCode2() {
		return code2;
	}



	/**
	 * @param code2 the code2 to set
	 */
	public void setCode2(String code2) {
		this.code2 = code2;
	}



	/**
	 * @return the code3
	 */
	public String getCode3() {
		return code3;
	}



	/**
	 * @param code3 the code3 to set
	 */
	public void setCode3(String code3) {
		this.code3 = code3;
	}
	
	
	
	
	
	
}
